home *** CD-ROM | disk | FTP | other *** search
/ PC Open 101 / PC Open 101 CD 2.bin / CD2 / PDF / Corsi / PHP / lezione_1 / vettore.php < prev   
Encoding:
PHP Script  |  2004-06-21  |  692 b   |  30 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3.     <head>
  4.     <title>Array</title>
  5.     </head>
  6.     <body>
  7.     <pre>
  8.         <?php
  9.         $vettore_a = array (2, 5, 7, 9, 11);
  10.         // dichiarazione esplicita con elementi solo numerici
  11.  
  12.         $vettore_b = array (2, "pippo", true, 1.24, array (1,2,3));
  13.         // dichiarazione esplicita con elementi misti
  14.  
  15.         $vettore_d[0] = 2;
  16.         $vettore_d[1] = "pippo";
  17.         // dichiarazione implicita con elementi misti
  18.  
  19.         echo "<br>Vettore_a:<br>";
  20.         print_r ($vettore_a);
  21.  
  22.         echo "<p>Vettore_b:<br>";
  23.         print_r ($vettore_b);
  24.  
  25.         echo "<p>Vettore_d:<br>";
  26.         print_r ($vettore_d);
  27.         ?>
  28.     </pre>
  29.     </body>
  30. </html>